Optimal. Leaf size=124 \[ \frac {\left (2 a^2-3 b^2\right ) x}{2 b^3}-\frac {2 \left (a^2-b^2\right )^{3/2} \tan ^{-1}\left (\frac {b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{a b^3 d}-\frac {\tanh ^{-1}(\cos (c+d x))}{a d}+\frac {a \cos (c+d x)}{b^2 d}-\frac {\cos (c+d x) \sin (c+d x)}{2 b d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.18, antiderivative size = 124, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {2974, 3136,
2739, 632, 210, 3855} \begin {gather*} -\frac {2 \left (a^2-b^2\right )^{3/2} \text {ArcTan}\left (\frac {a \tan \left (\frac {1}{2} (c+d x)\right )+b}{\sqrt {a^2-b^2}}\right )}{a b^3 d}+\frac {x \left (2 a^2-3 b^2\right )}{2 b^3}+\frac {a \cos (c+d x)}{b^2 d}-\frac {\tanh ^{-1}(\cos (c+d x))}{a d}-\frac {\sin (c+d x) \cos (c+d x)}{2 b d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 210
Rule 632
Rule 2739
Rule 2974
Rule 3136
Rule 3855
Rubi steps
\begin {align*} \int \frac {\cos ^3(c+d x) \cot (c+d x)}{a+b \sin (c+d x)} \, dx &=\frac {a \cos (c+d x)}{b^2 d}-\frac {\cos (c+d x) \sin (c+d x)}{2 b d}-\frac {\int \frac {\csc (c+d x) \left (-2 b^2-a b \sin (c+d x)-\left (2 a^2-3 b^2\right ) \sin ^2(c+d x)\right )}{a+b \sin (c+d x)} \, dx}{2 b^2}\\ &=\frac {\left (2 a^2-3 b^2\right ) x}{2 b^3}+\frac {a \cos (c+d x)}{b^2 d}-\frac {\cos (c+d x) \sin (c+d x)}{2 b d}+\frac {\int \csc (c+d x) \, dx}{a}-\frac {\left (a^2-b^2\right )^2 \int \frac {1}{a+b \sin (c+d x)} \, dx}{a b^3}\\ &=\frac {\left (2 a^2-3 b^2\right ) x}{2 b^3}-\frac {\tanh ^{-1}(\cos (c+d x))}{a d}+\frac {a \cos (c+d x)}{b^2 d}-\frac {\cos (c+d x) \sin (c+d x)}{2 b d}-\frac {\left (2 \left (a^2-b^2\right )^2\right ) \text {Subst}\left (\int \frac {1}{a+2 b x+a x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{a b^3 d}\\ &=\frac {\left (2 a^2-3 b^2\right ) x}{2 b^3}-\frac {\tanh ^{-1}(\cos (c+d x))}{a d}+\frac {a \cos (c+d x)}{b^2 d}-\frac {\cos (c+d x) \sin (c+d x)}{2 b d}+\frac {\left (4 \left (a^2-b^2\right )^2\right ) \text {Subst}\left (\int \frac {1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,2 b+2 a \tan \left (\frac {1}{2} (c+d x)\right )\right )}{a b^3 d}\\ &=\frac {\left (2 a^2-3 b^2\right ) x}{2 b^3}-\frac {2 \left (a^2-b^2\right )^{3/2} \tan ^{-1}\left (\frac {b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{a b^3 d}-\frac {\tanh ^{-1}(\cos (c+d x))}{a d}+\frac {a \cos (c+d x)}{b^2 d}-\frac {\cos (c+d x) \sin (c+d x)}{2 b d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.17, size = 143, normalized size = 1.15 \begin {gather*} -\frac {-4 a^3 c+6 a b^2 c-4 a^3 d x+6 a b^2 d x+8 \left (a^2-b^2\right )^{3/2} \tan ^{-1}\left (\frac {b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )-4 a^2 b \cos (c+d x)+4 b^3 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-4 b^3 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+a b^2 \sin (2 (c+d x))}{4 a b^3 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.37, size = 180, normalized size = 1.45
method | result | size |
derivativedivides | \(\frac {\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}+\frac {\left (-2 a^{4}+4 a^{2} b^{2}-2 b^{4}\right ) \arctan \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{a \,b^{3} \sqrt {a^{2}-b^{2}}}+\frac {\frac {2 \left (\frac {b^{2} \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}+a b \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {b^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2}+a b \right )}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}+\left (2 a^{2}-3 b^{2}\right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b^{3}}}{d}\) | \(180\) |
default | \(\frac {\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}+\frac {\left (-2 a^{4}+4 a^{2} b^{2}-2 b^{4}\right ) \arctan \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{a \,b^{3} \sqrt {a^{2}-b^{2}}}+\frac {\frac {2 \left (\frac {b^{2} \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}+a b \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {b^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2}+a b \right )}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}+\left (2 a^{2}-3 b^{2}\right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b^{3}}}{d}\) | \(180\) |
risch | \(\frac {x \,a^{2}}{b^{3}}-\frac {3 x}{2 b}+\frac {a \,{\mathrm e}^{i \left (d x +c \right )}}{2 b^{2} d}+\frac {a \,{\mathrm e}^{-i \left (d x +c \right )}}{2 b^{2} d}+\frac {i \sqrt {a^{2}-b^{2}}\, a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i \left (\sqrt {a^{2}-b^{2}}-a \right )}{b}\right )}{d \,b^{3}}-\frac {i \sqrt {a^{2}-b^{2}}\, \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i \left (\sqrt {a^{2}-b^{2}}-a \right )}{b}\right )}{d b a}-\frac {i \sqrt {a^{2}-b^{2}}\, a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i \left (\sqrt {a^{2}-b^{2}}+a \right )}{b}\right )}{d \,b^{3}}+\frac {i \sqrt {a^{2}-b^{2}}\, \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i \left (\sqrt {a^{2}-b^{2}}+a \right )}{b}\right )}{d b a}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{a d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{a d}-\frac {\sin \left (2 d x +2 c \right )}{4 b d}\) | \(320\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.44, size = 350, normalized size = 2.82 \begin {gather*} \left [-\frac {a b^{2} \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 2 \, a^{2} b \cos \left (d x + c\right ) + b^{3} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - b^{3} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - {\left (2 \, a^{3} - 3 \, a b^{2}\right )} d x - {\left (-a^{2} + b^{2}\right )}^{\frac {3}{2}} \log \left (-\frac {{\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a b \sin \left (d x + c\right ) - a^{2} - b^{2} - 2 \, {\left (a \cos \left (d x + c\right ) \sin \left (d x + c\right ) + b \cos \left (d x + c\right )\right )} \sqrt {-a^{2} + b^{2}}}{b^{2} \cos \left (d x + c\right )^{2} - 2 \, a b \sin \left (d x + c\right ) - a^{2} - b^{2}}\right )}{2 \, a b^{3} d}, -\frac {a b^{2} \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 2 \, a^{2} b \cos \left (d x + c\right ) + b^{3} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - b^{3} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - {\left (2 \, a^{3} - 3 \, a b^{2}\right )} d x - 2 \, {\left (a^{2} - b^{2}\right )}^{\frac {3}{2}} \arctan \left (-\frac {a \sin \left (d x + c\right ) + b}{\sqrt {a^{2} - b^{2}} \cos \left (d x + c\right )}\right )}{2 \, a b^{3} d}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\cos ^{4}{\left (c + d x \right )} \csc {\left (c + d x \right )}}{a + b \sin {\left (c + d x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.49, size = 183, normalized size = 1.48 \begin {gather*} \frac {\frac {2 \, \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right )}{a} + \frac {{\left (2 \, a^{2} - 3 \, b^{2}\right )} {\left (d x + c\right )}}{b^{3}} - \frac {4 \, {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (a\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + b}{\sqrt {a^{2} - b^{2}}}\right )\right )}}{\sqrt {a^{2} - b^{2}} a b^{3}} + \frac {2 \, {\left (b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 2 \, a\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{2} b^{2}}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 14.03, size = 1320, normalized size = 10.65 \begin {gather*} \frac {\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{a\,d}-\frac {\sin \left (2\,c+2\,d\,x\right )}{4\,b\,d}-\frac {3\,\mathrm {atan}\left (\frac {2\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^3-3\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b^2+2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^3}{-2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^3+3\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b^2+2\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^3}\right )}{b\,d}+\frac {a\,\cos \left (c+d\,x\right )}{b^2\,d}+\frac {2\,a^2\,\mathrm {atan}\left (\frac {2\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^3-3\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b^2+2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^3}{-2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^3+3\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b^2+2\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^3}\right )}{b^3\,d}+\frac {\mathrm {atan}\left (\frac {-a^6\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,{\left (-a^6+3\,a^4\,b^2-3\,a^2\,b^4+b^6\right )}^{3/2}\,16{}\mathrm {i}-a^{12}\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {-a^6+3\,a^4\,b^2-3\,a^2\,b^4+b^6}\,16{}\mathrm {i}+b^6\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,{\left (-a^6+3\,a^4\,b^2-3\,a^2\,b^4+b^6\right )}^{3/2}\,64{}\mathrm {i}-a^3\,b^3\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,{\left (-a^6+3\,a^4\,b^2-3\,a^2\,b^4+b^6\right )}^{3/2}\,42{}\mathrm {i}+a^3\,b^9\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {-a^6+3\,a^4\,b^2-3\,a^2\,b^4+b^6}\,66{}\mathrm {i}-a^5\,b^7\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {-a^6+3\,a^4\,b^2-3\,a^2\,b^4+b^6}\,176{}\mathrm {i}+a^7\,b^5\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {-a^6+3\,a^4\,b^2-3\,a^2\,b^4+b^6}\,178{}\mathrm {i}-a^9\,b^3\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {-a^6+3\,a^4\,b^2-3\,a^2\,b^4+b^6}\,81{}\mathrm {i}-a^2\,b^4\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,{\left (-a^6+3\,a^4\,b^2-3\,a^2\,b^4+b^6\right )}^{3/2}\,116{}\mathrm {i}+a^4\,b^2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,{\left (-a^6+3\,a^4\,b^2-3\,a^2\,b^4+b^6\right )}^{3/2}\,72{}\mathrm {i}+a^2\,b^{10}\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {-a^6+3\,a^4\,b^2-3\,a^2\,b^4+b^6}\,148{}\mathrm {i}-a^4\,b^8\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {-a^6+3\,a^4\,b^2-3\,a^2\,b^4+b^6}\,460{}\mathrm {i}+a^6\,b^6\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {-a^6+3\,a^4\,b^2-3\,a^2\,b^4+b^6}\,577{}\mathrm {i}-a^8\,b^4\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {-a^6+3\,a^4\,b^2-3\,a^2\,b^4+b^6}\,368{}\mathrm {i}+a^{10}\,b^2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {-a^6+3\,a^4\,b^2-3\,a^2\,b^4+b^6}\,120{}\mathrm {i}+a\,b^5\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,{\left (-a^6+3\,a^4\,b^2-3\,a^2\,b^4+b^6\right )}^{3/2}\,32{}\mathrm {i}+a^5\,b\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,{\left (-a^6+3\,a^4\,b^2-3\,a^2\,b^4+b^6\right )}^{3/2}\,14{}\mathrm {i}+a^{11}\,b\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {-a^6+3\,a^4\,b^2-3\,a^2\,b^4+b^6}\,14{}\mathrm {i}}{3\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^{12}\,b^3-9\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^{11}\,b^4-37\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^{10}\,b^5+54\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^9\,b^6+161\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^8\,b^7-137\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^7\,b^8-351\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^6\,b^9+180\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^5\,b^{10}+416\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^4\,b^{11}-120\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^3\,b^{12}-256\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2\,b^{13}+32\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b^{14}+64\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^{15}}\right )\,\sqrt {-a^6+3\,a^4\,b^2-3\,a^2\,b^4+b^6}\,2{}\mathrm {i}}{a\,b^3\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________